home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Magazine / GraphicsCards / StormMesa / mklib.ggi < prev    next >
Text File  |  1998-12-15  |  2KB  |  76 lines

  1. #!/bin/sh
  2.  
  3. # Make a shared library for GGI
  4.  
  5. #--identification------------------------------------------------------
  6.  
  7. # $Id: mklib.ggi,v 1.1 1998/07/08 01:27:06 brianp Exp $
  8.  
  9. # $Log: mklib.ggi,v $
  10. # Revision 1.1  1998/07/08 01:27:06  brianp
  11. # Initial revision
  12. #
  13.  
  14. #--common--------------------------------------------------------------
  15.  
  16. # Usage:  mklib libname major minor file.o ...
  17. #
  18. # First argument is name of output library (LIBRARY)
  19. # Second arg is major version number (MAJOR)
  20. # Third arg is minor version number (MINOR)
  21. # Rest of arguments are object files (OBJECTS)
  22.  
  23. LIBRARY=$1
  24. shift 1
  25.  
  26. MAJOR=$1
  27. shift 1
  28.  
  29. MINOR=$1
  30. shift 1
  31.  
  32. OBJECTS=$*
  33.  
  34. #--platform------------------------------------------------------------
  35. if [ $LIBRARY = "libglut.so" ] ; then
  36.     GGILIBS="-lggi -lX11 -lXext"
  37. fi
  38.  
  39. if [ $LIBRARY = "libMesaGL.so" ] ; then
  40.     GGILIBS="-lggi -lX11 -lXext"
  41. fi
  42.  
  43. # the following provided by Thomas Hiller (Hiller@tu-harburg.d400.de)
  44.  
  45. VERSION="${MAJOR}.${MINOR}"
  46.  
  47. LIBNAME=`basename $LIBRARY`
  48. ARNAME=`basename $LIBNAME .so`.a
  49. DIRNAME=`dirname $LIBRARY`
  50.  
  51. gcc -shared -Wl,-soname,${LIBNAME}.${MAJOR} -o ${LIBRARY}.${VERSION} ${OBJECTS} ${GGILIBS}
  52. (cd $DIRNAME; ln -s ${LIBNAME}.${VERSION} ${LIBNAME}.${MAJOR})
  53.  
  54. ln -s ${LIBNAME}.${MAJOR} ${LIBRARY}
  55.  
  56.  
  57. # also make regular .a files,
  58. # provided by Danek Duvall (duvall@dhduvall.student.princeton.edu)
  59.  
  60. ar ruv ${DIRNAME}/${ARNAME} ${OBJECTS}
  61. ranlib ${DIRNAME}/${ARNAME}
  62.  
  63.  
  64. # Print a reminder about shared libs:
  65. DIR=`cd .. ; pwd`
  66. echo
  67. echo "******Be sure to add" ${DIR}"/lib to your LD_LIBRARY_PATH variable"
  68. echo
  69. sleep 2
  70.  
  71.  
  72.  
  73. #### NOTES:
  74. # One Mesa user reports having to run the "ldconfig -v" command to make
  75. # Linux aware of the shared libs.
  76.